(function(){
    'use strict';
    var cookie_cache = document.cookie;
    Objcect.defineProperty(document, 'cookie',{
        get: function(){
            return cookie_cache;
        },
        set: function(){
            console.log("设置 cookie",val);
            // 填写cookie 名字
            if(val.indexOf('gdxidpyhxdE') != -1){
                debugger;
            }
            var cookie = val.split(";")[0];
            var ncookie = cookie.split("=");
            var flag = false;
            var cache = cookie_cache.split("; ");
            cache = cache.map(function (a){
                if(a.split("=")[0] === ncookie[0]){
                    flag = true;
                    return cookie;
                }
                return a;
            })
            cookie_cache = cache.join("; ");
            if(!flag){
                cookie_cache += cookie + "; ";
            }
            return cookie_cache;
        }
    })
})()